Completed
Push — master ( 7cb640...ba6ef7 )
by greg
01:21
created

sort.js ➔ describe(ꞌSortꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 19
rs 9.4285

2 Functions

Rating   Name   Duplication   Size   Complexity  
A sort.js ➔ ... ➔ before 0 7 1
A sort.js ➔ ... ➔ it(ꞌcoreUtils.sort.shuffleꞌ) 0 5 1
1
var chai = require('chai');
2
var path = require('path');
3
var fse = require('fs-extra');
4
5
var config = require('../src/cli').config
6
config.set({root: path.join(__dirname,'fixtures')})
7
8
var Manager = require('../src/cli').Manager;
9
var coreUtils = require('../src/cli').coreUtils
10
11
describe('Sort', function() {
12
  before( function(done) {
13
    Manager.instance.init()
14
      .then(function () {
15
        done()
16
        
17
      }.bind(this))
0 ignored issues
show
unused-code introduced by
The call to bind does not seem necessary since the function does not use this. Consider calling it directly.
Loading history...
18
  });
19
20
  /**
21
   * coreUtils.sort.shuffle
22
   * 
23
   */
24
  it('coreUtils.sort.shuffle', function() {
25
  	var list = Manager.instance.getList()
26
  	var shuffled = coreUtils.sort.shuffle(list)
27
  	chai.expect(shuffled[0].name).to.be.oneOf(['article-2.json', 'article-1.json', 'homepage-1.json']);
28
  });
29
});
30